﻿using Microsoft.AspNetCore.Mvc;

namespace GrpcClientDemo.Controllers
{
    [ApiController]
    [Route("[controller]/[action]")]
    public class HelloController : ControllerBase
    {
        readonly Greeter.GreeterClient service;
        public HelloController(Greeter.GreeterClient service) 
        { 
            this.service = service;
        }


        [HttpGet(Name = "Echo")]
        public string Echo(string name)
        {
            return service.SayHello(new HelloRequest { Name = name }).Message;
        }

    }
}
